package com.zhu.wx.service;

import com.zhu.wx.entity.RecMsg;
import com.zhu.wx.entity.ResMsg;
import com.zhu.wx.strategy.WxRecStrategy;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 取消订阅事件消息服务类
 */
@Service
public class WxRecUnSubscribeService implements WxRecStrategy {
    @Override
    public ResMsg execute(RecMsg recMsg) {
        String content = recMsg.getContent();
        String fromusername = recMsg.getFromUserName();
        String tousername = recMsg.getToUserName();
        Map<String,String> map = new HashMap<>();
        map.put("ToUserName",fromusername);
        map.put("FromUserName",tousername);
        map.put("CreateTime",String.valueOf(System.currentTimeMillis()));
        map.put("MsgType","text");
        map.put("Content",content);
        return null;
    }
}
